import request from '@/axios'

/**
 *
 * 获取菜单列表
 */
export const getMenuListApi = () => {
  return request.get({ url: '/api/Menu/getMenus' })
}

export const getRoleMenuListApi = (params) => {
  return request.get({ url: '/api/Menu/getRoleMenus', params })
}

export const searchRoleApi = (params) => {
  // return request.get({ url: '/mock/role/table' })
  return request.get({ url: '/api/Role/SearchRoleMenus', params })
}

/**
 * 添加菜单
 * @param data
 * @returns
 */
export const addMenuApi = (data) => {
  return request.post({ url: '/api/Menu/addMenu', data })
}

/**
 * 删除菜单
 * @param data
 * @returns
 */
export const deleteMenuApi = (data) => {
  return request.post({ url: '/api/Menu/DeleteMenu', data })
}

/**
 * 添加菜单
 * @param data
 * @returns
 */
export const updateMenuApi = (data) => {
  return request.post({ url: '/api/Menu/UpdateMenu', data })
}
